﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

namespace WoogiUI
{
    public static class ButtonEx
    {
        public static void SetBtnEvent(this GameObject t, MonoBehaviour recveiObj, UIEventType type, ButtonEvent _ButtonEven)
        {
            if (t != null)
            {
                WoogiButton wbtn = t.GetComponent<WoogiButton>();
                if(wbtn!=null)
                {
                    wbtn.SetEvent(recveiObj, type, _ButtonEven);
                }
            }
        }

        public static void SetButtonInteractable(this GameObject t,bool isValue)
        {
            if (t != null)
            {
                Button btn = t.GetComponent<Button>();
                if (btn != null)
                {
                    btn.interactable = isValue;
                }
            }
        }
    }
}
